/************************************************************************
 * Author: Ron Gallerie
 * File: mac.idl
 * Date: 11/13/06
 ************************************************************************/



module SDR_FM3TR {

  enum hoppingSubBand {
    HSB1,
    HSB2,
    HSB3
  };

  // This should be a sequence of doubles
  typedef double freqHopSet;

  // Medium Access Control interface
  // properties of the MAC Control component
  struct MAC_ControlProperties {
    double              hop_rate;
    hoppingSubBand      freq_hop_sub_band;
    freqHopSet          freq_hop_set;
    boolean             flow_control_on;
  };


  // Link Layer Control interface
  interface LLC_Control {

    // Not yet implemented - void establishStream();
    void startStream();
    void stopStream();
    // Not yet implemented - void releaseStream();

  };

  // Medium Access Layer Control interface
  module MAC_Signaling {

    /* The following interface is provided by the local MAC Component
     *  so the waveform receiver components can delegate the error
     *  acknowledgementcontrol
     */
    typedef unsigned long PacketID;
    interface MAC_ErrorControl_XmitLocal {
      oneway void signalNAK(in PacketID error_packet);
    };
    interface MAC_ErrorControl_ReceiveLocal {
      oneway void signalACK();
      oneway void signalNAK();
    };

    /* The following interface is provided by the local MAC Component
     *  so the waveform receiver components can delegate the flow
     *  control
     */
    interface MAC_FlowControl_Local {

      oneway void signalHighWatermark();
      oneway void signalLowWatermark();
      oneway void signalEmpty();

    };

    /* The following interface is a local one to allow the MAC Control
     *  component to control the hopping for the local RF transmission
     */
    interface MAC_Hopping_Local {

      oneway void configureHopping(in float hop_rate, 
				   in hoppingSubBand freq_hop_sub_band, 
				   in freqHopSet freq_hop_set);
    };

    /*
     * The following interface will be replaced in a radio
     * implementing WF transmission by the MAC Signaling Frame
     * Structure
     */
    enum MAC_Signal_Ack {
      ACK,
      NAK
    };
    enum MAC_Signal_FlowControl {
      LOW_WATERMARK,
      HIGH_WATERMARK,
      EMPTY,
      NOOP
    };

    interface MAC_Signal_Remote {

      oneway void SendFeedback(in MAC_Signal_Ack ack, 
      			       in MAC_Signal_FlowControl fc);
    };

  };
};

